// IPDlg.cpp : implementation file
//

#include "stdafx.h"
#include "GStation.h"
#include "IPDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CIPDlg dialog


CIPDlg::CIPDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CIPDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CIPDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CIPDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CIPDlg)
	DDX_Control(pDX, IDC_IPADDRESS1, m_ip);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CIPDlg, CDialog)
	//{{AFX_MSG_MAP(CIPDlg)
	ON_BN_CLICKED(IDOK, OnOk)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CIPDlg message handlers

void CIPDlg::OnOk() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	ip.Empty();
	BYTE nField0,  nField1,  nField2,  nField3;
	m_ip.GetAddress( nField0, nField1, nField2, nField3 );
	ip.Format("%d.%d.%d.%d",nField0, nField1, nField2, nField3);
	CDialog::OnOK();
}

BOOL CIPDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_ip.SetAddress( 192, 168, 0, 2 );
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
